home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 10 / Amoszine 10 (Disk 3 of 3).adf / Text_Files.lha / pp_lib_amos.txt3 < prev    next >
Text File  |  1995-12-11  |  2KB  |  51 lines

  1.  AJ>  I've been trying to figure out how to write the crunched file.
  2.  AJ>  I'll show you what I've come up with after looking in some books -
  3.  AJ> I've  never written files using doslibrary!
  4.  
  5. Its dead easy, probably the easiest lib of all to write for, you're
  6. spot on with what you have already done with Open(), ppWriteWhatsit(),
  7. Write(), Close() etc.
  8.  
  9.  AJ>  Step 2 is where I'm stuck.
  10.  AJ>  The info you gave me was
  11.  AJ>  success = ppWriteDataHeader ( lock , efficiency , crypt , checksum );
  12.  AJ>  ULONG                         BPTR   ULONG        BOOL    ULONG
  13.  AJ>  D0                            D0     D1           D2      D3:16
  14.  
  15.  AJ>  The problem is I've no idea what to load the registers with.
  16.  AJ>  Guess-time:
  17.  AJ>    Do I by any chance load D0 with the filehandle?
  18.  
  19. Yes, the filehandle acts as a 'lock' on the file so no other process
  20. can access it while you are using it.
  21.  
  22.  AJ>    Presumably efficiency is the same as it is in the other routines?
  23.  
  24. Indeed it is.
  25.  
  26.  AJ>    Do I load D2 with 0 since no encryption has been used?
  27.  
  28. Yep.? (Y,n,c): 
  29.  
  30.  AJ>  Also,
  31.  AJ>   What do BPTR and :16 mean?
  32.  
  33. A BPTR is a hold-over from the days when DOS was written in BCPL.
  34. Unless you are programming in assembler you don't have to worry about
  35. it, it's just a 'pointer' that you use as a handle to certain DOS
  36. objects.
  37.  
  38. The :16 means that only 16 bits of the register are used, even though 
  39. all 32 bits are passed to the routine, the upper 16 bits must be 0.
  40.  
  41.  AJ>  Sorry for asking you yet more questions!
  42.  
  43. It gives me summat to do! I've not been here much in the past month or 
  44. so, too busy with exams :o(
  45.  
  46. See ya,
  47. __
  48. |_)_ _ _|
  49. | (_|(_)l
  50.  
  51.